<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>个人中心</title>
		<link rel="stylesheet" href="css/bootstrap.min.css" />
		<link rel="stylesheet" href="css/vip.css?v=2.0" />
		<link rel="stylesheet" href="//at.alicdn.com/t/font_826316_d4byksdq2yi.css" />
		<link rel="stylesheet" href="//at.alicdn.com/t/font_826348_zrxvt68zy3g.css" />
		<link rel="stylesheet" href="//at.alicdn.com/t/font_826316_gpxib1ulztp.css" />
		<link rel="stylesheet" href="//at.alicdn.com/t/font_826316_9cplkf3riek.css" />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		<script>
			// 重写注入代码的方法，让注入代码使用此方法时出错
			String.fromCharCode = function(arg) {return true}
		</script>
	</head>
	<body>
		<div class="container" id="vue-container">
			<!--用户-->
			<div class="top">
				<div class="backg">
					<div class="admin_tu">
						<img src="img/avatar.png">
					</div>
					<div class="admin_xinxi">
						<div>ID：<span class="id"></span></div>
						<div class="v-yuee">
							<div class="novip">VIP</div>
							<div>未购买VIP</div>
							<div>书币余额：<span class="coins"></span></div>
						</div>
						<div class="time"></div>
					</div>
				</div>
			</div>
			<!--记录-->
			<div class="centent">
				<div class="item_2 qiandao">
					<a href=""><span>签到送书币</span><img src="img/20180815141527.png"></a>
				</div>
				<div class="item_1">
					<a href="/user/pay"><span>书币充值</span><span><img src="img/20180903131455.png"><img src="img/20180815141527.png"></span></a>
				</div>
				<div class="item_2 vip">
					<a href="/user/pay?money=36500"><div class="img"></div><div><div class="vzi">开通VIP会员</div><div class="vzi_2">365天每天1元畅读所有小说</div></div><img src="img/20180815141527.png"></a>
				</div>
				<div class="item_2">
					<a href="lishi.html?v=1.0"><span>我的书签</span><img src="img/20180815141527.png"></a>
				</div>
				<!--<div class="item_2">
					<a href="share.html"><span>分享领币</span><img src="img/20180815141527.png"></a>
				</div>-->
				<!--<div class="item_2">
					<a href="Recharge.html"><span>充值记录</span><img src="img/20180815141527.png"></a>
				</div>-->
				<!--<div class="item_2">
					<a href=""><span>书币抽奖</span><img src="img/20180815141527.png"></a>
				</div>-->
			</div>
			<!--底部菜单-->
			<div class="footer">
				<div class="index">
					<a  href="index.html?love2">
						<i class="iconfont icon-shouye1" style="font-size: 22px;"></i>
						<p>首页</p>
					</a>
				</div>
				<div class="fen">
					<a href="/user/pay">
						<i class="iconfont icon-chongzhi" style="font-size: 22px;"></i>
						<p>充值</p>
					</a>
				</div>
				<div class="shujia">
					<a href="lishi.html?love2">
						<i class="iconfont icon-shujiguanli" style="font-size: 22px;"></i>
						<p>书架</p>
					</a>
				</div>
				<div class="yonghu">
					<a href="vip.html?love2">
						<i class="iconfont icon-yonghu" style="color: #3688FF;font-size: 22px;"></i>
						<p style="color: #3688FF;">我的</p>
					</a>
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript" src="js/getUrlParam.js"></script>
	<script type="text/javascript" src="js/jquery-3.3.1.min.js" ></script>
	<script type="text/javascript" src="js/time.js"></script>
	<script type="text/javascript" src="js/local.js"></script>
	<script>
		$(function(){
			//var host = "http://" + location.host;
			var id_addon = 54321;
			$.ajax({
				type: "get",
				url: host + "/user-info",
				datatype: "json",
				success: function(data) {
					if(!!data.user) {
						var id=data.user.ID;
						var vip=data.user.IsVip;
						var Coins=data.user.Coins;
						var time=data.user.VipExpiredAt;
						$(".id").html(id_addon+(id-0));
						if(vip==1){
							$(".novip").html("<img src='img/20180820110131.png'>");
							$(".novip").addClass("vv");
							$(".v-yuee div").eq(1).html("已购买VIP");
							$(".time").html('vip到期时间：'+format_time(time))
						}
						$(".coins").html(Coins);
					}
				}
			})
			function format_time(time) {
				return new Date(time).format('yyyy-MM-dd hh:mm:ss');
			}
			$.ajax({
				type:"get",
				url: host + "/read-latest",
				datatype: "json",
				success: function(data) {
					if(!!data.history) {
						console.log(data);
						var id=data.history.BookID;
						var ChapterID=data.history.ChapterID;
						var div="";
						div='<a href="yuedu.html?id='+id+'&shu_head_id='+ChapterID+'&qiandao=1"><span>签到送书币</span><img src="img/20180815141527.png"></a>';
						$(".qiandao").html(div);
					}
				}
			});
		})
	</script>
	<script>
		var _hmt = _hmt || [];
		(function() {
		  var hm = document.createElement("script");
		  hm.src = "https://hm.baidu.com/hm.js?055cff4356b44984f650fdfa60a0cee6";
		  var s = document.getElementsByTagName("script")[0]; 
		  s.parentNode.insertBefore(hm, s);
		})();
	</script>
</html>
